﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms.VisualStyles;

namespace WinFormsApp1
{
    [Serializable]
    public class AhcObject
    {
        public string configName { get; set; }
        public string configDefaultService { get; set; }
        public string configFolderAnnoucement { get; set; }
        public string configFolderRollsign { get; set; }
        public string configFolderSidePlate { get; set; }
        public string configFolderKrueger { get; set; }
        public bool configIsMask { get; set; } = true;
        public BindingList<Terminal> terminals = new BindingList<Terminal>();
        public BindingList<Station> stations = new BindingList<Station>();
        public BindingList<Route> routes = new BindingList<Route>();
        
        public AhcObject() {
            /*terminals.Add(new Terminal() { terminalName = "Tain Cuo", terminalCode = "4" });
            terminals.Add(new Terminal() { terminalName = "Tong An", terminalCode = "3" });

            stations.Add(new Station() { stationName = "Zhong Ke Yuan" });
            stations.Add(new Station() { stationName = "Da Xue Cheng" });

            routes.Add(new Route() { routeName = "K1 - Bei Zhan" });
            routes.Add(new Route() { routeName = "K6 - Ma Tou" });*/
        }

        public void switchTerminal(int index1, int index2)
        {
            Terminal tmp = terminals[index1];
            terminals[index1] = terminals[index2];
            terminals[index2] = tmp;
        }
    }

    public class Terminal
    {
        public string terminalName { get; set; }
        public string terminalCode { get; set; } = "0";
        public bool terminalAllExit { get; set; } = false; // TODO: 未完成UI层
        public string terminalNameDisplay
        {
            get
            {
                return terminalCode + ": " + terminalName;
            }
            set { }
        }
        public string terminalIbis1 { get; set; }
        public string terminalAnnax1 { get; set; }
        public string terminalAnnax2 { get; set; }
        public string terminalAnnaxSide { get; set; }
        public string terminalRlbTexture { get; set; }
        public string terminalIbis2 { get; set; }
        public string terminalAddPlateTexture { get; set; }
        public string terminalKruegerTexture { get; set; }


        public Terminal Clone()
        {
            return (Terminal)this.MemberwiseClone();
        }
    }

    public class Station
    {
        public string stationName { get; set; }
        public string stationIbis1 { get; set; }
        public string stationInsideDisplay1 { get; set; }
        public string stationInsideDisplay2 { get; set; }
        public string stationIbis2 { get; set; }

        public Station Clone()
        {
            return (Station)this.MemberwiseClone();
        }
    }

    public class Route
    {
        public string routeName { get; set; }
        public int routeTerminalIndex { get; set; } = 0;
        public string routeIbis { get; set; } = "1";
        public string routeTour { get; set; } = "1";
        public BindingList<string> routeStations { get; set; } = new BindingList<string>();
        public string routeNameDisplay
        {
            get
            {
                return routeIbis + "/" + routeTour + ": " + routeName;
            }
            set { }
        }
    }
}


